package io.gitee.mojingjiao.day05;

import org.junit.Assert;
import org.junit.Test;

import java.util.HashMap;
import java.util.Map;

public class TextMap {
    @Test
    public void test(){
        Assert.assertEquals("星期一",getNameByNum(1));
        Assert.assertEquals("星期二",getNameByNum(2));
        Assert.assertEquals("星期三",getNameByNum(3));
    }
    public String getNameByNum(int num) {
        Map<Integer, String> map = new HashMap<>();
        map.put(1, "星期一");
        map.put(2, "星期二");
        map.put(3, "星期三");

        return map.get(num);
    }
  public int getNumByName(String name){
        Map<String,Integer>map=new HashMap<>();
        map.put("星期一",1);
      map.put("星期二",2);
      map.put("星期三",3);
      return map.get(name);
  }






    @Test
    public void test1(){

    }
}
